package com.inter.controller;

import com.inter.my.YinXing;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author yinxing
 * @date 2022-09-08
 */
@RestController
@Slf4j
public class LoginController {

    @RequestMapping("/login")
    @YinXing(encry = true)
    public Object login(@RequestBody Map<String, String> data){
        log.info("获取到用户名:[{}],密码:[{}]",data.get("username"),data.get("password"));
        Map<String, Object> result = new HashMap<>();
        result.put("username","root");
        result.put("data","success");
        return result;
    }

}
